file_name='input.txt'
line_count=0
word_count=0
with open(file_name,'r',encoding='utf-8') as file:
    for line in file:
        word=line.split()
        line_count+=1

def getWords(filepath):
    file = open(filepath)
    wordOne=[]
    while(file):
        line = file.readline()
        word = line.split('/')
        wordOne.extend(word)
        if (not line):          
            break  
    wordtwo=[]
    for i in wordOne:
        wordtwo.extend(i.split())
    return wordtwo
    word3 = []
    for i in wordtwo:
        word3.extend(i.split('\t'))
    return word3
    word4 = []
    for i in word3:
        word4.extend(i.split('\n'))
    return word4

def getCharacters(filepath):
    file = open(filepath)
    word1=[]
    while(file):
        character = file.read()
        word1.extend(character)
        if (not character):          
            break
    character_count=0
    for i in word1:
         if ord(i) < 256:
            character_count += 1
    return character_count

print('单词数：',len(getWords('input.txt')))
print('字符数：',getCharacters('input.txt'))
print('行数：',line_count)

                                                      
